﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace canyinguanlixitong
{
    public partial class bianji编辑 : Form
    {
        public bianji编辑()
        {
            InitializeComponent();
        }
        public string stu;
        string jk = "Data Source=.;Initial Catalog=Supermarket management system;Integrated Security=True";
        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            xg();
        }
        public void xg()
        {
            DataSet an = new DataSet("studer");
            SqlConnection con = new SqlConnection(jk);
            con.Open();
            string an1 = this.textBox1.Text.ToString();
            string an2 = this.textBox2.Text.ToString();
            string an3 = this.dateTimePicker3.Text.ToString();
            string an4 = this.comboBox2.Text.ToString();
            string an5 = this.comboBox3.Text.ToString();
            string an6 = this.textBox4.Text.ToString();
            string an7 = this.textBox7.Text.ToString();
            string sql = @"UPDATE [Scheduled management] SET ydID='" + an1 + "',yhhm='" + an2 + "',ydTime='" + an3 + "',czmc='" + an4 + "',ydCz='" + an5 + "',ydMoney='" + an6 + "',ydQi='" + an7 + "' where ydID='" + stu + "'";
            SqlDataAdapter ann = new SqlDataAdapter(sql, con);
            SqlCommand com = new SqlCommand(sql, con);
            string i = Convert.ToString(com.ExecuteNonQuery());
            if (i != null)
            {
                MessageBox.Show("修改成功", "提示");
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
